adTempus API
|
Gets objects for a given class that match specified criteria.
HRESULT GetObjectsOfClassWhere(ClassIDEnum cid, IObjectSelector * selector, [out,retval] IADTObjects** objects);
GetObjectsOfClassWhere(ClassIDEnum cid, IObjectSelector selector, [out,retval] IADTObjects* objects);
Sub GetObjectsOfClassWhere(cid As ClassIDEnum, selector As IObjectSelector, objects As [out,retval] IADTObjects*)
Parameters |
Description |
[in]ClassIDEnum cid |
The CID of the class for which you want to retrieve objects. |
[in] IObjectSelector * selector |
An IObjectSelector object used to filter the objects. |
[out,retval] IADTObjects** objects |
On return, contains a collection of the selected objects. |
GetObjectsOfClassWhere is equivalent to (and no more efficient than) calling GetObjectsForClass and then iterating through the returned objects to determine which meet your criteria.
When you use GetObjectsOfClassWhere you build a selector class that implements IObjectSelector and pass this selector to the method. The session then calls IObjectSelector.SelectObject for each object of the class, and returns only those for which SelectObject returns True.
GetObjectsOfClassWhere uses client-side filtering. That is, it must retrieve all objects for the class from the server, and then apply the filter. Use GetObjectsWhere to do server-side filtering.
Many objects are not meant to be directly retrieved. If you attempt to retrieve one of these objects, the method will return an empty collection. This applies to most objects that are not descended from IADTIndependentObject. For example, a JobStep object cannot be directly retrieved; you must obtain it from the Steps collection of the Job that owns it.
GetObjectsOfClassWhere returns all objects for the class regardless of what permissions you do or do not have for those objects. Before attempting to use an object from the collection, use its CanPerform method to make sure you have the appropriate permission, or your operation will fail.
For example, if you are building a user interface that lists jobs for the user to edit, you should check each job returned by the method and only list those for which the user as at least saView permission.
adTempus API Reference version 3.0.0.0, revised 10/30/2008
|